package com.graduation.apiservice.controller;

import com.graduation.common.domain.dto.PageDTO;
import com.graduation.pojo.query.LegalDocumentSearchQuery;
import com.graduation.pojo.vo.LegalDocumentSearchVO;
import com.graduation.service.ElasticSearchService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
@RequiredArgsConstructor
public class SearchController {

    private final ElasticSearchService elasticSearchService;

    @GetMapping("/legalDocument")
    public PageDTO<LegalDocumentSearchVO> searchLegalDocument(LegalDocumentSearchQuery query) {
        return elasticSearchService.searchLegalDocument(query);
    }

}
